package com.mastercard.labs

import java.util.Date;
import java.util.List;

class User {
	
	enum Status {ACTIVE,LOCKED,SUSPEND,INACTIVE,PENDING_EMAIL_ACTIVICATION,PENDING_PHONE_ACTIVATION}
	
    String username
    String passwordHash
	String name
	String nric
	String mobile
	String phone
	String email
	Status status
	Date dateCreated
		
    static hasMany = [ roles: Role, permissions: String]

    static constraints = {
        username(nullable: false, blank: false, unique: true)
		passwordHash nullable: true
    }
	
	def beforeInsert() {
		dateCreated = new Date()
	}
}
